<template>
  <div>
    <!-- 导航 -->
    <el-breadcrumb separator=">">
      <el-breadcrumb-item>所在位置</el-breadcrumb-item>
      <el-breadcrumb-item>首页</el-breadcrumb-item>
      <el-breadcrumb-item>我的企业</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider />
    <div class="border border-#eee mt-5 p-5 bg-#f7f7f7">
      <span>当前进度：客户经理已反馈</span>
      <span>已授信</span>
    </div>

    <div class="mt-5">
      <el-tabs v-model="activeName" @tab-click="handleClick">
        <el-tab-pane label="融资需求信息" name="first">
          <el-descriptions class-name="text-center" border :column="2" size="large">
            <el-descriptions-item align="center" label="融资需求编号">
              {{ info.applyNo }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="融资金额">
              {{ info.applyAmountMin }}-{{ info.applyAmountMax }}万元
            </el-descriptions-item>
            <el-descriptions-item align="center" label="融资年利率">
              {{ info.rateMin }}-{{ info.rateMax }}%
            </el-descriptions-item>
            <el-descriptions-item align="center" label="融资期限">
              {{ info.maturityMin }}-{{ info.maturityMax }}月
            </el-descriptions-item>
            <el-descriptions-item align="center" label="期望到账时间">
              {{ transformDict('loan_term', info.arrivalTimeType) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="还款方式">
              {{ transformDict('repay_way', info.repaymentType) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="担保类型">
              {{ transformDict('guarantee_type', info.guaranteeType) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="申请时间">
              {{ info.createTime }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="产品名称">
              {{ info.productName }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="产品额度范围">
              {{ info.productAmountMin }}-{{ info.productAmountMax }}万元
            </el-descriptions-item>
            <el-descriptions-item align="center" label="产品期限">
              {{ info.productMaturityMin }}-{{ info.productMaturityMax }}月
            </el-descriptions-item>
            <el-descriptions-item align="center" label="产品利率范围">
              {{ info.productRateMin }}-{{ info.productRateMax }}%
            </el-descriptions-item>
            <el-descriptions-item align="center" label="所属机构">
              {{ info.organization }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="客户经理">
              100-200万元
            </el-descriptions-item>
            <el-descriptions-item align="center" label="联系方式">
              {{ info.contactorTell }}
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane label="企业信息" name="second">
          <el-descriptions class-name="text-center" border :column="2" size="large">
            <el-descriptions-item align="center" label="企业名称">
              {{ info.information.enterpriseName }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="统一社会信用代码">
              {{ info.information.creditCode }}
            </el-descriptions-item>

            <el-descriptions-item align="center" label="企业人数">
              {{ transformDict('numberOfCompany', info.information.staffNum) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="企业行业">
              <span class="truncate max-w-40 inline-block">{{ info.information.industryName }}</span>
            </el-descriptions-item>
            <el-descriptions-item align="center" label="是否小微企业">
              {{ info.information.microFlag == 1 ? '是' : '否' }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="企业所在区域">
              {{ info.information.provinceName }}/{{ info.information.cityName }}/{{ info.information.areaName }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="注册地址">
              {{ info.information.legalAddress }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="经营地址">
              {{ info.information.corrAddress }}
            </el-descriptions-item>

            <el-descriptions-item align="center" label="企业法人">
              {{ info.legal.name }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="企业联系人">
              {{ info.enterpriseContactor }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="联系电话">
              {{ info.contactorTell }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="企业盈亏状态">
              {{ transformDict('enterpriseProfit', info.profitState) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="上年度开票营业收入">
              {{ transformDict('invoicingOperatingIncome', info.incomeData) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="上年度纳税金额">
              {{ info.taxAmount }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="连续纳税年限">
              {{ info.information.declareDeal }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="纳税等级">
              {{ transformDict('ratepayingLevel', info.information.taxLevel) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="开户行">
              {{ transformDict('loanBank', info.information.depositBank) }}
            </el-descriptions-item>
            <el-descriptions-item align="center" label="之前贷款银行">
              {{ transformDict('loanBank', info.loanBankName) }}
            </el-descriptions-item>
            <el-descriptions-item align="left" :span="3" label="当前贷款余额">
              <span class="ml-7">
                {{ info.loanLeftAmount }}万元
              </span>
            </el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>
<script setup lang="ts">
import { getfinanceInfo } from '@/api/financeDemad';
import { useDict, transformDict } from '@/hooks/dict';
useDict('repay_way', 'guarantee_type', 'loan_term', 'businessPremises', 'invoicingOperatingIncome', 'ratepayingLevel', 'enterpriseProfit', 'pawnType', 'loanBank', 'numberOfCompany')
const route = useRoute()
const info = reactive({
  applyAmountMax: 0,
  applyAmountMin: 0,
  applyNo: null,
  applyState: null,
  applyWay: null,
  areaName: "",
  areaSiteId: null,
  arrivalTimeType: "",
  cityName: "",
  citySiteId: null,
  collateralFlag: "",
  contactorTell: "",
  corrAreaSiteId: "",
  corrAreaSiteName: null,
  corrCitySiteId: "",
  corrCitySiteName: null,
  corrProvinceSiteId: "",
  corrProvinceSiteName: null,
  createBy: "",
  createTime: "",
  creditCodeDelete: null,
  deleted: null,
  enterpriseContact: null,
  enterpriseContactor: "",
  enterpriseId: "",
  enterpriseName: "",
  financialAdvisor: null,
  financialAdvisorTell: null,
  guaranteeType: "",
  id: "",
  ids: null,
  incomeData: "",
  information: {},
  legal: {
    name: "",
    legalLiveAddress: "",
    employmentYears: 0,
    shareholdingRatio: 0
  },
  loanBankName: "",
  loanBankOther: null,
  loanLeftAmount: 0,
  maturityMax: "",
  maturityMin: "",
  mortgageEstateAddress: null,
  mortgageEstateArea: null,
  mortgageEstateCity: null,
  mortgageEstateProvince: null,
  mortgageEstateType: null,
  operator: null,
  organizationName: null,
  orientation: null,
  productId: null,
  productName: null,
  profitState: "",
  provinceName: "",
  provinceSiteId: null,
  rateMax: 0,
  rateMin: 0,
  reason: null,
  remark: null,
  remarks: null,
  repaymentType: "",
  siteCode: null,
  siteId: null,
  siteName: null,
  source: null,
  sourceChannel: null,
  taxAmount: "",
  taxLevel: null,
  ticketId: null,
  updateBy: "",
  updateTime: "",
  version: null,
  wlEnterpriseId: null
})
onMounted(() => {
  getfinanceInfo(route.query.id).then(res => {
    Object.assign(info, res.data)
  })
})

const activeName = ref('first')
</script>
<style lang="scss" scoped>
@use '@/assets/styles/tabs_ui.scss';
</style>
